import {
	http,
	POST,
	GET,
	PUT,
	DELETE
} from "@/utils/request.js";




// 小程序登录
export const login = (data = {}, other = {
		custom: {
			auth: false,
			loading: false
		}
	}) =>
	GET("/data/api.wechat/session")(data, other);
// /data/api.wechat/session /data/api.wechat/oauth
// 获取首页数据 header:{'Content-Type': 'application/json; charset=utf-8'},
export const getIndexData = (data = {}, other = {
		custom: {
			auth: false,
			loading: true
		}
	}) =>
	POST("/data/api.data/index")(data, other);


// 获取用户信息
export const getUserInfo = (data = {}, other = {
		custom: {
			auth: true,
			loading: false
		}
	}) =>
	POST("/data/api.auth.center/get")(data, other);

// 更新用户信息
export const updateUserInfo = (data = {}, other = {
		custom: {
			auth: true,
			loading: true
		}
	}) =>
	POST("/data/api.auth.center/set")(data, other);

// 上传Base64图片
export const uploadFile = (data = {}, other = {
		custom: {
			auth: true,
			loading: true
		}
	}) =>
	POST("/data/api.auth.center/image")(data, other);



// 自动获取用户手机号
export const getPhoneNumber = (data = {}, other = {
		custom: {
			auth: true,
			loading: true
		}
	}) =>
	POST("/data/api.wxapp/userPhone")(data, other);


// 获取文章列表
export const getArticleList = (data = {}, other = {
		custom: {
			auth: true,
			loading: true
		}
	}) =>
	POST("/data/api.news/getItem")(data, other);

// 获取文章分类
export const getArticleClassification = (data = {}, other = {
		custom: {
			auth: false,
			loading: true
		}
	}) =>
	GET("/data/api.news/getCate")(data, other);


// 获取单页
export const getSinglePageData = (data = {}, other = {
		custom: {
			auth: true,
			loading: true
		}
	}) =>
	POST("/data/api.data/getData")(data, other);


// 添加收藏
export const addCollect = (data = {}, other = {
		custom: {
			auth: true,
			loading: true
		}
	}) =>
	GET("/data/api.auth.goods/addCollect")(data, other);


// 获取收藏列表
export const getCollectList = (data = {}, other = {
		custom: {
			auth: true,
			loading: true
		}
	}) =>
	GET("/data/api.auth.goods/getCollect")(data, other);


// 取消收藏
export const cancelCollect = (data = {}, other = {
		custom: {
			auth: true,
			loading: true
		}
	}) =>
	POST("/data/api.auth.goods/delCollect")(data, other);


// 获取项目分类
export const getProjectCate = (data = {}, other = {
		custom: {
			auth: false,
			loading: true
		}
	}) =>
	GET("/data/api.goods/getCate")(data, other);


// 获取项目标签
export const getProjectMark = (data = {}, other = {
		custom: {
			auth: true,
			loading: true
		}
	}) =>
	GET("/data/api.goods/getMark")(data, other);


// 获取项目列表
export const getProjectList = (data = {}, other = {
		custom: {
			auth: true,
			loading: true
		}
	}) =>
	GET("/data/api.auth.goods/getGoods")(data, other);


// 获取项目详情
export const getProjectDetails = (data = {}, other = {
		custom: {
			auth: true,
			loading: true
		}
	}) =>
	GET("/data/api.auth.goods/detail")(data, other);

// 获取项目地区
export const getProjectCity = (data = {}, other = {
		custom: {
			auth: true,
			loading: true
		}
	}) =>
	GET("/data/api.data/regionTree")(data, other);



// 门店列表
export const getStoreList = (data = {}, other = {
		custom: {
			auth: true,
			loading: true
		}
	}) =>
	POST("/data/api.auth.store/index")(data, other);



// 我的足迹
export const getStoreHistoryList = (data = {}, other = {
		custom: {
			auth: true,
			loading: true
		}
	}) =>
	POST("/data/api.auth.store/getHistory")(data, other);



// 门店详情
export const getStoreDetails = (data = {}, other = {
		custom: {
			auth: true,
			loading: true
		}
	}) =>
	POST("/data/api.auth.store/detail")(data, other);


// 项目列表
export const getProjectItemList = (data = {}, other = {
		custom: {
			auth: true,
			loading: true
		}
	}) =>
	POST("/data/api.auth.item/index")(data, other);


// 项目详情
export const getProjectItemDetails = (data = {}, other = {
		custom: {
			auth: true,
			loading: true
		}
	}) =>
	POST("/data/api.auth.item/detail")(data, other);


// 项目预约详情
export const getProjectItemTimes = (data = {}, other = {
		custom: {
			auth: true,
			loading: true
		}
	}) =>
	POST("/data/api.auth.item/itemTimes")(data, other);

// 项目预约
export const bookProject = (data = {}, other = {
		custom: {
			auth: true,
			loading: true
		}
	}) =>
	POST("/data/api.auth.admit/add")(data, other);


// 项目预约列表
export const bookOrderList = (data = {}, other = {
		custom: {
			auth: true,
			loading: true
		}
	}) =>
	POST("/data/api.auth.admit/index")(data, other);


// 项目公告列表
export const getNoticeList = (data = {}, other = {
		custom: {
			auth: true,
			loading: true
		}
	}) =>
	POST("/data/api.store/news")(data, other);


// 授权
export const oauth = (data = {}, other = {
		custom: {
			auth: false,
			loading: false
		}
	}) =>
	GET("/data/api.wechat/oauth")(data, other);



/**
 * 分类查询 
 * cateids?: string;
 */

/**
 * 分页条数
 *  limit?: number;
 */

/**
 * 标签查询
 *  marks?: string;
 */

/**
 * 项目名，模糊匹配
 *   name?: string;
 */

/**
 * 第几页
 *  page: number;
 */